def sift(li, low, high):
    i = low
    j = 2*i + 1
    temp = li[i]
    while j <= high:
        if j + 1 <= high and li[j+1].value > li[j].value:
            j += 1
        if li[j].value > temp.value:
            i = j
            j = 2*i+1
        else:
            break
    li[i] = temp
